<template>
    <div>
        <!-- 轮播图 -->
        <wrapper :lunbotuList="lunbotuList" :isfull="true"></wrapper>
        <!-- 六宫格 -->
        <ul class="mui-table-view mui-grid-view mui-grid-9">
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <router-link to="/home/newslist">
                    <img src="../../images/menu1(1).png" alt="">
                    <div class="mui-media-body">新闻资讯</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <router-link to="/home/photolist">
                    <img src="../../images/menu2.png" alt="">
                    <div class="mui-media-body">图片分享</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <router-link to="/home/goodslist">
                    <img src="../../images/menu3.png" alt="">
                    <div class="mui-media-body">商品购买</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <a href="#">
                    <img src="../../images/menu4.png" alt="">
                    <div class="mui-media-body">location</div>
                </a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <a href="#">
                    <img src="../../images/menu5.png" alt="">
                    <div class="mui-media-body">Search</div>
                </a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                <a href="#">
                    <img src="../../images/menu6.png" alt="">
                    <div class="mui-media-body">Phone</div>
                </a>
            </li>
        </ul> 
    </div>
</template>

<script>
    import {Toast} from 'mint-ui'
    import wrapper from '../subcomponents/Wrapper.vue'
    export default {
        data() {
            return {
                lunbotuList: [
                    
                ]
            }
        },
        created() {
            // Toast('正在加载数据')
            this.getLunbotu()
        },
        methods: {
            getLunbotu() {
                const path = require('path')
                this.lunbotuList = [
                    {img:  path.join(__dirname,'src/images/l1.jpg')},
                    {img:  path.join(__dirname,'src/images/l2.jpg')},
                    {img:  path.join(__dirname,'src/images/l3.jpg')},
                    {img:  path.join(__dirname,'src/images/l4.jpg')},
                    {img:  path.join(__dirname,'src/images/l5.jpg')},
                    {img:  path.join(__dirname,'src/images/l6.jpg')}
                ]
                this.$http.get('api/getlunbo').then(res => {
                    // console.log(res);
                    if (res.body.status === 0) {
                        this.lunbotuList = res.body.message
                    } else {
                        Toast('获取轮播图数据失败')
                    }
                })
            }
        },
        components: {
            wrapper //轮播图组件
        }
    }
</script>

<style lang="scss" scoped>
    

    .mui-grid-9{
        background-color: #fff;
        border: none;
        
        .mui-table-view-cell{
            border: 0;

            img{
                width: 60px;
                height: 60px;
            }

            div{
                font-size: 13px;
            }
        }

        
    }
</style>